import request from '@/utils/request'

// 获取管理员信息
export function getInfo(current, size) {
    return request({
        url: 'api/administrator/info',
        method: 'post',
        data: {
            current,
            size
        }
    })
}
// 增加管理员
export function addAdmin(username, password, disabled) {
    return request({
        url: 'api/administrator/save',
        method: 'post',
        data: {
            username,
            password,
            disabled
        }
    })
}
// 编辑管理员(修改密码)
export function editAdmin(id, password) {
    return request({
        url: 'api/administrator/edit',
        method: 'post',
        data: {
            id,
            password,
        }
    })
}
// 重置密码
export function resetPass(id) {
    return request({
        url: 'api/administrator/reset',
        method: 'post',
        data: {
            id,
        }
    })
}
// 软删除
export function deleteAdmin(id) {
    return request({
        url: 'api/administrator/delete',
        method: 'post',
        data: {
            id,
        }
    })
}
// 启用账号
export function enableAdmin(id) {
    return request({
        url: 'api/administrator/enable',
        method: 'post',
        data: {
            id,
        }
    })
}
// 禁用账号
export function disableAdmin(id) {
    return request({
        url: 'api/administrator/disable',
        method: 'post',
        data: {
            id,
        }
    })
}